package com.myself.mapper;

import com.myself.entity.Permission;
import com.myself.entity.Role;
import com.myself.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Description:
 *
 * @Author: Liuzemin
 * @Date: 2020/7/10 13:42
 */
public interface UserMapper {
    User findById(Long id);

    void create(User user);

    void update(User user);

    List<User> findAll();

    void delete(Long id);

    User findByName(String username);

    List<Role> findRole(String username);

    List<Permission> findPermission(String username);

    void correlationRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);

    boolean exists(Long userId, Long roleId);

    void deleteAllUserRoles(Long id);
}
